<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
<%@include file="/common/common.jsp"%>
<%@include file="/common/skins/skin0/component.jsp" %>
<h:css href="/css/style1/style-custom.css"/>
<%--
- Author(s): pengweiling
- Date: 2012-07-20 11:22:02
- Description:
--%>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <title>
      工作帐录入
    </title>
  </head>
  <body>
    <e:datasource name="weordertasks" type="entity" path="com.hms.OrderMgr.order.WeOrdertasks" />
    <h:form name="data_form" action="com.hms.OrderMgr.WorkbookMaintain.flow" method="post" onsubmit="return submitDatacell(this);">
      
      <l:equal property="_eosLastAccessAction" targetValue="update">
        <input type="hidden" name="_eosFlowAction" value="updateSubmit" >
      </l:equal>
      <l:equal property="_eosLastAccessAction" targetValue="insert">
        <input type="hidden" name="_eosFlowAction" value="insertSubmit" >
      </l:equal>
       
      <%@include file="/OrderMgr/WorkBookHeader.jsp" %>

    </h:form>
    <script>
    
function toBusinessDate(date){
   var year =  date.getFullYear(),
       month = date.getMonth();
       day = date.getDate();
   
   var target = new Date(year, month, day, 12, 0, 0);
   
   if (date.getTime() > target.getTime()){//如果是12点钟之后，就划入当前营业日期
      return new Date(year, month, day);  
   }else{//如果划入前一个营业日期
      var down = new Date(date.getTime() - 24 * 60 * 60*1000);
      return new Date(down.getFullYear(), down.getMonth(), down.getDate());
   }
}
    
      function submitDatacell(frm) {
        return checkForm(frm);
      }
      
      $id('cbd').setValue(dateToString(toBusinessDate(stringToDate('<b:write property="weordertasks/dcreatedbusinessdate"/>'))));
      
    </script>
  </body>
</html>
